/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package OtherPubs;

import Rout.*;
import com.sun.org.omg.SendingContext.CodeBasePackage.URLSeqHelper;
import java.util.ArrayList;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;
import org.testng.annotations.*;

public class MacKeepInv {
    private GoBefore browser = new GoBefore();
//    private RemoteControl browser;
    private ArrayList<String> urls = new ArrayList<String>();
    
    
    
    @BeforeMethod
    public void setUp() throws Exception {
        urls.add("http://www.amazon.com/Samsung-Galaxy-Tab-7-Inch-White/dp/B00J8DL78O/ref=sr_1_2?ie=UTF8&qid=1421058464&sr=8-2&keywords=galaxy");
        urls.add("http://www.disk-doctors-mac-data-recovery.en.softonic.com/mac");
        urls.add("http://www.ebay.com/itm/New-Black-Hybrid-Impact-Hard-Case-Cover-Screen-for-Samsung-Galaxy-S-IV-S4-i9500-/390749060265");
        urls.add("http://www.dallasnews.com/");
        urls.add("http://www.wfaa.com/story/entertainment/television/programs/good-morning-texas/2014/09/04/sneak-peek-samsung-phones/15074713/");
        

        System.out.println("\n Run test: " + getClass().getSimpleName());  
        browser.setXpFilename(null);
        browser.setRepDir(getClass().getSimpleName());
        browser.setEnableSafeBrow(Boolean.FALSE);
        browser.setRemoteDriver("192.168.4.93"); //Mac VMWare   
               
    }
       

@Test //Void Footer Baner
    public void Test() throws Exception {              
                        for (String url : urls) {
              
        browser.setCurURL(url);
                            System.out.println("\n\nTest case: "+ (urls.indexOf(url)+1) + "\nTest URL is: " + url);
        browser.setUp();
        browser.maximazeBrowser();
        Thread.sleep(2000);
        browser.ipDetect();
        Thread.sleep(6000);
        browser.takeSimpleScreenShot();
        Thread.sleep(60000*2);
        browser.refreshCurlURL(1, 5);   
        browser.getClicker().sendKeys(Keys.PAGE_DOWN).perform();
        browser.getClicker().sendKeys(Keys.PAGE_DOWN).perform();
        Thread.sleep(6000);
        browser.takeSimpleScreenShot();                
        Thread.sleep(60000*2);
        browser.refreshCurlURL(1, 4);
        browser.takeSimpleScreenShot();
        Thread.sleep(60000*2);
        browser.refreshCurlURL(1, 4);
        browser.getClicker().sendKeys(Keys.PAGE_DOWN).perform();
        browser.takeSimpleScreenShot();
        browser.getDriver().quit();
         } 
    }
    
  
    @AfterMethod
    public void Down() throws Exception {
        browser.getDriver().quit();
        
    }
    
}
